        # 两人对话场景
        elif speakers.issubset({"left", "right"}):
            # 分别收集左右说话人的文本和voice_id
            left_texts = []
            right_texts = []
            left_voice_id = None
            right_voice_id = None
            
            for turn in dialogue:
                if turn.get("speaker") == "left" and "text" in turn:
                    left_texts.append(turn["text"])
                    if not left_voice_id and "voice_id" in turn and turn["voice_id"]:
                        left_voice_id = turn["voice_id"]
                elif turn.get("speaker") == "right" and "text" in turn:
                    right_texts.append(turn["text"])
                    if not right_voice_id and "voice_id" in turn and turn["voice_id"]:
                        right_voice_id = turn["voice_id"]
            
            # 如果没有自定义voice_id，使用默认的
            if not left_voice_id:
                left_voice_id = self.voice_ids.get("left", "pqHfZKP75CvOlQylNhV4")
            if not right_voice_id:
                right_voice_id = self.voice_ids.get("right", "Xb7hH8MSUJpSbSDYk0k2")
            
            # 获取声音信息
            left_voice_info = self.voice_manager.get_voice(left_voice_id)
            right_voice_info = self.voice_manager.get_voice(right_voice_id)
            
            # 完整文案（所有文本）
            full_copywriting = "\n".join(turn["text"] for turn in dialogue if "text" in turn)
            
            # 创建UUID文件夹
            folder_path = self.generate_uuid_folder()
            
            # 保存文案
            self.save_copywriting(folder_path, full_copywriting)
            
            # 为每个说话人生成单独的音频片段
            left_audio_paths = []
            right_audio_paths = []
            
            # 生成左侧说话人语音片段
            for i, text in enumerate(left_texts):
                if text.strip():  # 确保文本不为空
                    audio_path = folder_path / f"left_{i}.mp3"
                    self.add_audio(left_voice_id, text, audio_path)
                    left_audio_paths.append(str(audio_path))
            
            # 生成右侧说话人语音片段
            for i, text in enumerate(right_texts):
                if text.strip():  # 确保文本不为空
                    audio_path = folder_path / f"right_{i}.mp3"
                    self.add_audio(right_voice_id, text, audio_path)
                    right_audio_paths.append(str(audio_path))
            
            # 使用音频合并功能创建自然对话音频
            left_combined_path = folder_path / "left.mp3"
            right_combined_path = folder_path / "right.mp3"
            
            try:
                # 使用时间轴合并功能创建自然对话
                path1, path2 = merge_conversation_audio_timeline(
                    left_audio_paths, 
                    right_audio_paths, 
                    str(folder_path / "combined"),
                    pause_sec=0.6,
                    random_pause=True,
                    debug=True
                )
                
                # 重命名合并后的文件
                os.rename(path1, left_combined_path)
                os.rename(path2, right_combined_path)
                print(f"成功合并音频文件: {left_combined_path}, {right_combined_path}")
                
            except Exception as e:
                print(f"音频合并失败: {e}")
                # 如果合并失败，回退到简单合并
                # 合并文本
                left_text = "\n".join(left_texts)
                right_text = "\n".join(right_texts)
                
                # 生成左侧说话人语音
                left_success = self.add_audio(left_voice_id, left_text, left_combined_path)
                
                # 生成右侧说话人语音
                right_success = self.add_audio(right_voice_id, right_text, right_combined_path)
            
            # 复制背景图片（如果提供）或生成新图片
            background_dest = folder_path / "background.png"
            if background_image and os.path.exists(background_image):
                with open(background_image, "rb") as src, open(background_dest, "wb") as dst:
                    dst.write(src.read())
            else:
                # 生成图片提示词，传递整个dialogue JSON
                dialogue_json = json.dumps(data)
                success, result = self.generate_image_prompt(dialogue_json)
                if success:
                    # 生成图片
                    image_success, image_result = self.generate_image_from_prompt(result, str(background_dest))
                    if not image_success:
                        print(f"图片生成失败: {image_result}")
                else:
                    print(f"图片提示词生成失败: {result}")
            
            return {
                "success": True,
                "folder_path": str(folder_path),
                "left_audio_file": str(left_combined_path),
                "right_audio_file": str(right_combined_path)
            }